<template>
<div class="content">
    <mt-header fixed title="设备详情">
              <div slot="left">
    <mt-button icon="back" @click.native="goback()">返回</mt-button>
              </div>
    </mt-header>
    <div>
        <mt-cell title="一级告警" label="广东省深圳市高新园">
            <mt-button  @click.native="eliminate()" :type="buttonType">{{desc}}</mt-button>
        </mt-cell>
    </div>
</div>
</template>
<script>
import { MessageBox } from 'mint-ui'
export default {
  data () {
    return {
      desc: '消除',
      buttonType: 'danger'
    }
  },
  methods: {
    goback () {
      this.$router.go(-1)
    },
    eliminate () {
      let that = this
      if (this.buttonType === 'danger') {
        MessageBox.confirm('确定要消除这条告警?').then(action => {
          that.desc = '已消除'
          that.buttonType = ''
          this.$store.commit('setAlarmNum', 0)
        })
      }
    }
  }
}
</script>
<style lang="less" scoped>
.content{
    padding-top: 40px;
}
</style>
